﻿using System;

namespace Zo.Events
{
    /// <summary>
    /// 领域事件。
    /// </summary>
    public interface IEvent
    {
        /// <summary>
        /// 唯一标识。
        /// </summary>
        Guid ID { get; }

        /// <summary>
        /// 创建时间。
        /// </summary>
        DateTime Created { get; }
    }

    /// <summary>
    /// 领域事件基类。
    /// </summary>
    public abstract class EventBase : IEvent
    {
        public Guid ID => Guid.NewGuid();

        public DateTime Created => DateTime.Now;
    }
}